from pathlib import Path
path=Path('test.txt')
#contents=path.read_text()
#contents=contents.rstrip()
contents=path.read_text().rstrip()
print(contents)